﻿using System;

namespace ThinkAway.Net.Sockets
{
    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TProtocol"></typeparam>
    public interface IAppServer<TProtocol> where TProtocol : IProtocol 
    {
        /// <summary>
        /// 
        /// </summary>
        event EventHandler<ReveivedEventArgs> Received;
        /// <summary>
        /// 
        /// </summary>
        event EventHandler<ConnectedEventArgs> Connected;
        /// <summary>
        /// 
        /// </summary>
        event EventHandler<DisconnectedEventArgs> Disconnected;

        
        /// <summary>
        /// 
        /// </summary>
        void StartListener();
        /// <summary>
        /// 
        /// </summary>
        void StopListener();

        /// <summary>
        /// 
        /// </summary>
        /// <param name="protocol"></param>
        void SendMessage(TProtocol protocol);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="protocol"></param>
        void SendMessage(string sessionKey, TProtocol protocol);
    }
}
